public class 只出现一次的数字136 {

    public static void main(String[] args) {
        int[] nums = {1,1,2,2,3,3,4};
        System.out.println(singleNumber(nums));
    }
    // 1.异或
    public static int singleNumber(int[] nums) {
        int single = 0;
        for (int num : nums) {
            single ^=  num;
        }
        return single;
    }

    // 2.先排序，后遍历？
}
